package com.csun.dsms.model.dto.staff;

import com.csun.dsms.validator.DsmsPoorAddValidator;
import com.csun.dsms.validator.DsmsPoorEditValidator;
import com.csun.dsms.validator.DsmsStaffAddValidator;
import com.csun.dsms.validator.DsmsStaffEditValidator;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

/**
 * @author chisj chisj@foxmail.com
 * @version 1.0.0
 * @date 2021-09-22 17:14
 * @description: TODO
 */
@Data
public class StaffDto {

    /**
     * 服务人员id
     */
    @NotNull(message = "{staff.id.null}",
            groups = {DsmsStaffEditValidator.class})
    private Long id;

    /**
     * 所属公司
     */
    @NotNull(message = "{unit.id.null}",
            groups = {DsmsStaffAddValidator.class})
    private Long unitId;

    /**
     * 所属网格
     */
    @NotNull(message = "{area.id.null}",
            groups = {DsmsStaffAddValidator.class})
    private Long areaId;

    /**
     * 姓名
     */
    @NotNull(message = "{staff.name.null}",
            groups = {DsmsStaffAddValidator.class})
    @NotEmpty(message = "{staff.name.null}",
            groups = {DsmsStaffAddValidator.class})
    private String name;

    /**
     * 身份证
     */
    @NotNull(message = "{id.card.null}",
            groups = {DsmsStaffAddValidator.class})
    @NotEmpty(message = "{id.card.null}",
            groups = {DsmsStaffAddValidator.class})
    private String idCard;

    /**
     * 服务年限
     */
    @NotNull(message = "{staff.service.length.null}",
            groups = {DsmsStaffAddValidator.class})
    private Integer serviceLength;

    /**
     * 性别 0-女 1-男
     */
    @NotNull(message = "{staff.sex.null}",
            groups = {DsmsPoorAddValidator.class})
    @Range(min = 0, max = 2, message = "{staff.sex.range.error}",
            groups = {DsmsPoorAddValidator.class})
    private Integer sex;

    /**
     * 技能描述
     */
    @NotNull(message = "{staff.skill.null}",
            groups = {DsmsStaffAddValidator.class})
    @NotEmpty(message = "{staff.skill.null}",
            groups = {DsmsStaffAddValidator.class})
    private String skill;

    /**
     * 出生日期
     */
    @NotNull(message = "{staff.birthday.null}",
            groups = {DsmsStaffAddValidator.class})
    @NotEmpty(message = "{staff.birthday.null}",
            groups = {DsmsStaffAddValidator.class})
    private String birthday;

    /**
     * 手机号
     */
    @NotNull(message = "{mobile.no.null}",
            groups = {DsmsStaffAddValidator.class})
    @NotEmpty(message = "{mobile.no.null}",
            groups = {DsmsStaffAddValidator.class})
    private String mobileNo;

    /**
     * 密码
     */
    @NotNull(message = "{password.null}",
            groups = {DsmsStaffAddValidator.class})
    @NotEmpty(message = "{password.null}",
            groups = {DsmsStaffAddValidator.class})
    private String loginPwd;

    /**
     * 服务人员照片
     */
    @NotNull(message = "{staff.head.pic.null}",
            groups = {DsmsStaffAddValidator.class})
    @NotEmpty(message = "{staff.head.pic.null}",
            groups = {DsmsStaffAddValidator.class})
    private String headPic;

    /**
     * 描述
     */
    private String remark;
}
